﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BfLib.Text
{
    public static class StringsManager
    {
        public static string GetLinesThatContain(ref TextBox tb, string contains)
        {
            StringBuilder sb = new StringBuilder();
            foreach(string s in tb.Lines)
            {
                if(s.IndexOf(contains)>=0)
                    sb.Append(String.Format("{0}{1}", s, Environment.NewLine));
            }
            return sb.ToString();
        }

        public static string GetLinesThatDontContain(ref TextBox tb, string contains)
        {
            StringBuilder sb = new StringBuilder();
            foreach(string s in tb.Lines)
            {
                if(s.IndexOf(contains)<0)
                    sb.Append(String.Format("{0}{1}", s, Environment.NewLine));
            }
            return sb.ToString();
        }


    }
}
